home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
serial
/
callback.001
/
callback~
/
callback
/
lib
/
process
/
modemrespawn.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-07-28
|
614b
|
29 lines
#include "process.p"
#include "../../configure.h"
void modem_respawn()
{
FILE
*pslist;
char
buf[500];
int
kills;
if (!(pslist = popen(PSCMD, "r")))
error("Can't get processes list");
kills = 0; /* no process killed yet */
log(log_max, "Looking for %s-processes", getmodembase());
while (fgets(buf, 499, pslist)) /* walk all processes */
kills += modemkill(buf); /* kill if a modem process */
if (!kills)
log(log_on, "No modem process(es) killed");
pclose(pslist);
}